//package com.example.seckilldemo.config.mq;
//
//import org.springframework.amqp.core.Binding;
//import org.springframework.amqp.core.BindingBuilder;
//import org.springframework.amqp.core.HeadersExchange;
//import org.springframework.amqp.core.Queue;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * @Author Wangbaba
// * @Date 2024/3/21 14:33
// * @Version 1.0
// * mq配置类:headers模式
// */
//@Configuration
//public class RabbitMQHeadersConfig {
//
//    private static final String QUEUE01="queue_header01";
//    private static final String QUEUE02="queue_header02";
//    private static final String EXCHANG="headersExchange";
//
//    @Bean
//    public Queue queueHeader01(){
//        return new Queue(QUEUE01);
//    }
//    @Bean
//    public Queue queueHeader02(){
//        return new Queue(QUEUE02);
//    }
//    @Bean
//    public HeadersExchange headersExchange(){
//        return new HeadersExchange(EXCHANG);
//    }
//    @Bean
//    public Binding bindingHeader01(){
//        Map<String,Object> map =new HashMap<>();
//        map.put("color","red");
//        map.put("speed","low");
//        return BindingBuilder.bind(queueHeader01()).to(headersExchange()).whereAny(map).match();
//    }
//    @Bean
//    public Binding bindingHeader02(){
//        Map<String,Object> map =new HashMap<>();
//        map.put("color","red");
//        map.put("speed","fast");
//        return BindingBuilder.bind(queueHeader02()).to(headersExchange()).whereAny(map).match();
//    }
//
//}
